package com.kingmed.kmss.framework.feign.client.kmcs;

import com.kingmed.kmss.common.dto.kmcs.PsQueryDTO;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "LbFeignService", url = "${kmcs.url}", fallback = LbFeignFallbackService.class)
public interface LbFeignService {


    /**
     * 子公司获取默认实验室
     */
    @PostMapping(value = "/km-lb-server/esb/testitem/searchLabotoryAndOsByTestItemIdAndCorp.json",
            headers = {"targetServiceCode=${kmcs.lb.targetServiceDSCode:LB.LABMGT.SEARCHLABOTORYANDOSBYTESTITEMIDANDCORP}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response defaultLab(@RequestBody PsQueryDTO queryDTO);

    /**
     * 实验室检测项目ID获取指定外包方实验室列表
     */
    @PostMapping(value = "/km-lb-server/esb/testitem/searchsListByTestItemId.json",
            headers = {"targetServiceCode=${kmcs.lb.targetServiceWBSCode:LB.LABMGT.SEARCHOSLISTBYTESTITEMID}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response outLab(@RequestBody PsQueryDTO queryDTO);

    /**
     * 实验室检测项目ID获取检测系统列表
     */
    @PostMapping(value = "/km-lb-server/esb/testitem/searchTestSystemMdrByTestItemId.json",
            headers = {"targetServiceCode=${kmcs.lb.targetServiceJCSCode:LB.TESTITEM.SEARCHTESTSYSTEMHDRBYTESTITEMID}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response checkSystem(@RequestBody PsQueryDTO queryDTO);

    /**
     * 报告单模板列表
     */
    @PostMapping(value = "/km-lb-server/esb/rptmgt/searchReportModel1.json",
            headers = {"targetServiceCode=${kmcs.lb.targetServiceBGDMCode:LB.RPTMGT.SEARCHREPORTMODEL1}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response reportTemp(@RequestBody PsQueryDTO queryDTO);

    /**
     * 根据实验室检测项目ID获取结果单位列表
     */
    @PostMapping(value = "/km-lb-server/esb/testitem/searchResultRuleByTestItemId.json",
            headers = {"targetServiceCode=${kmcs.lb.targetServiceJGDWCode:LB.TESTITEM.SEARCHRESULTRULEBYTESTITEMID}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response resultDw(@RequestBody PsQueryDTO queryDTO);

}
